<% @title = "Stats" %>

<div class="stats">
  <h2 class="stat" data-icon="⟡">
    <%= t('stats.index.total_gems') %>
    <span class="stat__count"><%= number_with_delimiter @number_of_gems %></span>
  </h2>
  <h2 class="stat" data-icon="☺">
    <%= t('stats.index.total_users') %>
    <span class="stat__count"><%= number_with_delimiter @number_of_users %></span>
  </h2>
  <h2 class="stat" data-icon="⌄">
    <%= t('stats.index.total_downloads') %>
    <span class="stat__count"><%= number_with_delimiter @number_of_downloads %></span>
  </h2>
</div>

<h2 class="stats__graph__heading">
  <%= t('stats.index.all_time_most_downloaded') %>
</h2>

<header class="gems__header">
  <p class="gems__meter"><%= page_entries_info @most_downloaded, model: 'gem' %></p>
</header>

<% @most_downloaded.each do |gem| %>
  <div class="stats__graph__gem">
    <h3 class="stats__graph__gem__name"><%= link_to gem.name, rubygem_path(gem) %></h3>
    <div class="stats__graph__gem__meter-wrap">
      <div class="stats__graph__gem__meter t-item--hidden" data-bar_width="<%= stats_graph_meter(gem, @most_downloaded_count) %>">
        <span class="stats__graph__gem__count"><%= number_to_delimited gem.downloads %></span>
      </div>
    </div>
  </div>
<% end %>
<%= will_paginate @most_downloaded %>
